#include <bits/stdc++.h>
using namespace std;
const int N = 1e5+5;
int n,a[N],ans,tmp,s;
int main() {
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    cin >> n;
    for(int i=1; i<=n; i++) {
        cin >> a[i];
    }
    sort(a+1,a+n+1);
    for(int i=1; i<=n; i++) {
        if(a[i]==a[i-1]) {
            if(!tmp) ans++;
            else tmp--;
            s++;
        }
        else {
            tmp=s+tmp;
            if(!tmp) ans++;
            else tmp--;
            s=1;
        }
    }
    cout << ans << '\n';
    return 0;
}
//Air_Color5 CCCCCCCCCCCCCCCCCCCCCOrz
